package structural.proxy.static_proxy;

/**
 * @ClassName: SubjectProxy
 * @Description: 代理主题角色
 * @Author: liu-hao
 * @Date: 2023-04-09 21:06
 * @Version: 1.0
 **/
public class SubjectProxy implements Subject {

    private Subject subject;

    public SubjectProxy(Subject subject) {
        this.subject = subject;
    }

    @Override
    public void request() {
        before();
        this.subject.request();
        after();
    }

    private void before() {
        System.out.println("处理请求之前");
    }

    private void after() {
        System.out.println("处理请求之后");
    }
}
